package game.zqll.systems;

import com.artemis.Entity;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import game.zqll.PluginFileHandle;
import game.zqll.components.*;
import net.mostlyoriginal.api.system.core.PassiveSystem;

public class PlayerSystem extends PassiveSystem {

    private Entity player;
    public static final float SPEED = 200f;

    @Override
    protected void initialize() {
        super.initialize();
        player = world.createEntity();

        TextureRegionComp textureRegionComp = player.edit().create(TextureRegionComp.class);
        textureRegionComp.region = new TextureRegion(new Texture(new PluginFileHandle("bucket.png")));

        PosComp posComp = player.edit().create(PosComp.class);
        posComp.x = 0;
        posComp.y = 0;

        SizeComp sizeComp = player.edit().create(SizeComp.class);
        sizeComp.width = 32f;
        sizeComp.height = 32f;

        MoveComp moveComp = player.edit().create(MoveComp.class);
        player.edit().create(BucketComp.class);
    }

    public Entity get() {
        return player;
    }
}
